{template 'business_header'} 

{php load()->func('tpl')}
<style type="text/css">
    .btn{
        background-color:#337ab7;
    }
</style>

<section id="content">
    <section class="vbox">
        <section class="scrollable">
            <section class="hbox wrapper">

                <ul class="breadcrumb">
                    <li>
                        <a href="">
                            <i class="fa fa-shopping-cart"></i> 商铺管理
                        </a>
                    </li>
                    <li>
                        <a href="">添加商铺</a>
                    </li>
                    <li class="active">添加商铺基本信息</li>
                </ul>

                <header class="panel-heading bg-light lter mypanelhead">
                    <div class="row">
                        <div class="col-sm-1 add_m_title"> <strong class="pull-left">添加商铺</strong>
                        </div>
                        <div class="com-sm-2 text-right">
                            <a href="{php echo $this->createMobileUrl('business',array('uid' => $uid,'op' => 'dplist'))}" class="btn btn-s-sm m-r text-sm btn-info">
                                <i class="fa fa-list"></i> 所有商铺
                            </a>
                        </div>
                    </div>

                </header>
                <div class="panel-body bg-white">
                    <section class="wrapper">
                        <form class="form-horizontal" method="post" action="">
                            <input type='hidden' name='id' value='{$item['id']}' />
                            <div class="form-group">
                                <label class="col-sm-2 control-label">添加到小区</label>
                                <div class="col-sm-5">
                                    <label class="checkbox-inline">  
                                        <input type="checkbox" id="checkAll" name="checkAll">全部
                                    </label>
                                    {loop $regions $region}
                                        <label class="checkbox-inline">
                                          <input type="checkbox" id="" value="{$region['id']}" name='regionid[]' {if @in_array($region['id'], $regs)}checked='checked' {/if}> {$region['title']}
                                        </label>
                                    {/loop}
                                </div>
                            </div>
                            <div class="line line-dashed line-lg pull-in"></div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">商家名称</label>
                                <div class="col-sm-5"> <em class="req">*</em>
                                    <input type="text" class="form-control parsley-validated" placeholder="请输入商家名称" name="sjname" id="sjname" value='{$item['sjname']}'>
                                </div>
                            </div>
                            <div class="line line-dashed line-lg pull-in"></div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">展示图片</label>
                                <div class="col-sm-5">
                                    {php echo tpl_form_field_image('picurl', $item['picurl'])}

                                </div>
                            </div>
                            <div class="line line-dashed line-lg pull-in"></div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">联系人</label>
                                <div class="col-sm-5">
                                    <em class="req">*</em>
                                    <input type="text" class="form-control" placeholder="请输入商家联系人" name="contactname" value="{$item['contactname']}">
                                </div>
                            </div>
                            <div class="line line-dashed line-lg pull-in"></div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">手机</label>
                                <div class="col-sm-5">
                                    <em class="req">*</em>
                                    <input type="text" class="form-control parsley-validated" placeholder="请输入联系人手机" name="mobile" value="{$item['mobile']}">
                                </div>
                            </div>
                            <div class="line line-dashed line-lg pull-in"></div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">电话</label>
                                <div class="col-sm-5">
                                    <input type="text" class="form-control parsley-validated" placeholder="请输入商家电话" name="phone" value="{$item['phone']}">
                                </div>
                            </div>
                            <div class="line line-dashed line-lg pull-in"></div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">QQ号</label>
                                <div class="col-sm-5">
                                    <input type="text" class="form-control parsley-validated" placeholder="请输入商家QQ号" name="qq" value="{$item['qq']}">
                                </div>
                            </div>
                            <div class="line line-dashed line-lg pull-in"></div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">地区</label>
                                <div class="col-sm-5">
                                {php echo tpl_form_field_district('birth');}
                                </div>

                            </div>
                            <div class="line line-dashed line-lg pull-in"></div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">详细地址</label>
                                <div class="col-sm-5">
                                    <input type="text" class="form-control parsley-validated" placeholder="请输入详细地址" name="address" value="{$item['address']}">
                                </div>
                            </div>
                            <!-- tpl_ueditor 等这个函数可以用，在换编辑器-->
                            <div class="line line-dashed line-lg pull-in"></div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">商家简介</label>
                                <div class="col-sm-9">
                                    <em class="req">*</em>
                                    <textarea id="myeditor" placeholder="请输入商家简介" name="shopdesc" class="form-control richtext"  style="height:200px;">{$item['shopdesc']}</textarea>
                                    
                                </div>
                            </div>



                            <div class="line line-dashed line-lg"></div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">营业时间</label>
                                <div class="col-sm-5">
                                    <input type="text" class="form-control" placeholder="请输入营业时间：9:00-21:00" name="businnesstime" value="{$item['businnesstime']}">
                                </div>
                            </div>
                            <div class="line line-dashed line-lg"></div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">商家外链</label>
                                <div class="col-sm-5">
                                    <input type="text" class="form-control" placeholder="如若填写商家外链,微信端会直接跳转到该外链" name="businessurl" value="{$item['businessurl']}">
                                </div>
                            </div>
                            <div class="line line-lg m-t-lg"></div>
                            <div class="form-group">
                                <div class="col-sm-9 m-b-lg m-t-lg col-sm-offset-2">
                                    <button type="submit" class="btn btn-primary m-r-lg btn-s-sm">保存</button>
                                    <input type="hidden" name="token" value="{$_W['token']}" />
                                    <a class="btn btn-white btn-s-sm" href="javascript:history.go(-1);">返回</a>

                                </div>
                            </div>

                        </form>
                    </section>

                </div>

            </section>
        </section>
    </section>

<script type="text/javascript">
$(function() {
     $("#checkAll").click(function() {
         $('input[name="regionid[]"]').attr("checked",this.checked); 
     });
});
</script>
<script type="text/javascript">
    var category = {php echo json_encode($children)};
    require(['jquery', 'util'], function($, u){
        $(function(){
            u.editor($('.richtext')[0]);
        });
      
    });
</script>


</section>
<script type="text/javascript" src="{MODULE_URL}template/js/wxqsj.js"></script>
<script type="text/javascript" src="{MODULE_URL}template/js/jquery-ui.js"></script>
 

</body>
</html>
